-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #8084: autodoc: KeyError is raised on documenting a broken attribute #8085
Fix #8084: autodoc: KeyError is raised on documenting a broken attribute #8085
Conversation
…ken attribute ``typing.get_type_hints()`` raises KeyError when a class having invalid __module__ was given. This handles the exception not to crash on build documents.
I'm seeing a similar issue in sphinx/util/inspect.py at line 468, when processing a package that uses wxPython. It attempts to use 'sip' as the module key and get_type_hints raises a KeyError, crashing as described above. Is this part of the same issue, or should I file a new report? |
@efahl Please file a new issue please. It seems latest Sphinx catches all kinds of exceptions at that location. So I feel strange that you got KeyError. I need to know about the error in detail (stacktrace, versions, extensions and so on). |
Oops... I wrongly merged this into 3.x branch. I cherry-picked this to 3.2.x branch manually now. |
… an attribute Until Python 3.5.2, typing.get_type_hints() raises AttributeError if given object does not have `__code__` attribute. This handles the exception not to crash building documents. refs: python/cpython@991d14f
… an attribute Until Python 3.5.2, typing.get_type_hints() raises AttributeError if given object does not have `__code__` attribute. This handles the exception not to crash building documents. Note: The AttributeError was fixed at 3.5.3 refs: python/cpython@991d14f
Feature or Bugfix
Purpose
typing.get_type_hints()
raises KeyError when a class having invalidmodule was given. This handles the exception not to crash on build
documents.